#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <istream>
#include <vector>

using ll = int64_t;

ll n,K;
std::vector<ll> line;
std::vector<std::vector<std::vector<ll>>> dp;

static inline constexpr ll get1n(ll x){
    return __builtin_popcount(x);
}

int main(){
    std::iostream::sync_with_stdio(false);
    std::cin.tie(nullptr);

    std::cin>>n>>K;
    // std::cout<<n<<" "<<K<<"\n";
    line.reserve(n*n+1);
    line.push_back(0);
    for(ll msk=0;msk<(1ll<<n);++msk){
        for(ll i=1;i<=n;i++){
            if((msk>>i)&1){
                if((msk>>(i-1))&1 || msk>>(i+1)&1){
                    goto nxt;
                }
            }
        }
        line.push_back(msk);
        nxt:;
    }
    // for(ll i:line){
    //     char buff[10];
    //     memset(buff, 0, sizeof(buff));
    //     itoa(i, buff, 2);
    //     printf("%s\n",buff);
    // }
    dp.resize(n+1,std::vector<std::vector<ll>>(line.size(),std::vector<ll>(K+1)));

    
    for(ll j=1;j<line.size();j++){
        ll num1 = get1n(line[j]);
        if(num1>K)continue;
        dp[1][j][num1]=1;
    }

    for(ll i=2;i<=n;i++){
        for(ll j=1;j<line.size();j++){
            ll cur1n = get1n(line[j]);
            for(ll k=1;k<line.size();k++){
                ll k1n = get1n(line[k]);
                if(k1n+cur1n>K)continue;
                if(
                    line[j] & line[k]
                    || line[j] & (line[k]<<1)
                    || line[j] & (line[k]>>1)
                ){
                    continue;
                }else{
                    for(ll x=cur1n;x<=K;x++){
                        dp[i][j][x]+=dp[i-1][k][x-cur1n];
                    }
                }
            }
        }
    }

    ll ans=0;
    for(ll j=1;j<line.size();j++){
        ans+=dp[n][j][K];
    }
    std::cout<<ans<<"\n";
}